package com.eedi.framework.permission.dal.dataobject;

import com.baomidou.mybatisplus.annotation.*;
import com.eedi.framework.common.enums.CommonStatusEnum;
import com.eedi.framework.mybatis.core.type.JsonLongSetTypeHandler;
import com.eedi.framework.org.core.db.OrgInfoBaseDO;
import com.eedi.framework.permission.enums.OrgDataScopeEnum;
import com.eedi.framework.permission.enums.OrgRoleTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Set;

/**
 * 角色 DO
 *
 * @author liuyf
 */
@TableName(value = "org_role", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class OrgRoleDO extends OrgInfoBaseDO {


    /**
     * 角色ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String orgRoleId;
    /**
     * 角色名称
     */
    private String orgRoleName;
    /**
     * 角色标识
     * 枚举
     */
    private String orgRoleCode;
    /**
     * 角色排序
     */
    private Integer orgRoleSort;
    /**
     * 数据范围
     * 枚举 {@link OrgDataScopeEnum}
     */
    private OrgDataScopeEnum orgRoleDataScope;
    /**
     * 数据范围(指定部门数组)
     * 适用于 {@link #orgRoleDataScope} 的值为 {@link OrgDataScopeEnum#DEPT_CUSTOM} 时
     */
    @TableField(typeHandler = JsonLongSetTypeHandler.class)
    private Set<String> orgRoleDataScopeDeptIds;

    /**
     * 角色状态
     * 枚举 {@link CommonStatusEnum}
     */
    private CommonStatusEnum orgRoleStatus;
    /**
     * 角色类型
     * 枚举 {@link OrgRoleTypeEnum}
     */
    private OrgRoleTypeEnum orgRoleType;

    /**
     * 备注
     */
    private String orgRoleRemark;
}
